<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!--
        enter
        delete
        esc
        tab（特殊）--------keydown才可以。 
        up
        down
        left
        right
    -->
    <div id="root">
        <h1>您好，{{name}}</h1>
        <input type="text" @keyup.enter="showInfo">
    </div>

    <script>

        Vue.config.productionTip = false

        const x = new Vue({
            el:'#root', 
            data:{
                name:'魔法师'
            },
            methods: {
                showInfo(e){
                    console.log(e.target.value)
                }
            },
        })
    </script>
</body>
</html>